<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
<title>README.rst</title>
<style type="text/css">

/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.

See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/

/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
  border: 0 }

table.borderless td, table.borderless th {
  /* Override padding for "table.docutils td" with "! important".
     The right padding separates the table cells. */
  padding: 0 0.5em 0 0 ! important }

.first {
  /* Override more specific margin styles with "! important". */
  margin-top: 0 ! important }

.last, .with-subtitle {
  margin-bottom: 0 ! important }

.hidden {
  display: none }

.subscript {
  vertical-align: sub;
  font-size: smaller }

.superscript {
  vertical-align: super;
  font-size: smaller }

a.toc-backref {
  text-decoration: none ;
  color: black }

blockquote.epigraph {
  margin: 2em 5em ; }

dl.docutils dd {
  margin-bottom: 0.5em }

object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
  overflow: hidden;
}

/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
  font-weight: bold }
*/

div.abstract {
  margin: 2em 5em }

div.abstract p.topic-title {
  font-weight: bold ;
  text-align: center }

div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
  margin: 2em ;
  border: medium outset ;
  padding: 1em }

div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
  font-weight: bold ;
  font-family: sans-serif }

div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
  color: red ;
  font-weight: bold ;
  font-family: sans-serif }

/* Uncomment (and remove this text!) to get reduced vertical space in
   compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
  margin-bottom: 0.5em }

div.compound .compound-last, div.compound .compound-middle {
  margin-top: 0.5em }
*/

div.dedication {
  margin: 2em 5em ;
  text-align: center ;
  font-style: italic }

div.dedication p.topic-title {
  font-weight: bold ;
  font-style: normal }

div.figure {
  margin-left: 2em ;
  margin-right: 2em }

div.footer, div.header {
  clear: both;
  font-size: smaller }

div.line-block {
  display: block ;
  margin-top: 1em ;
  margin-bottom: 1em }

div.line-block div.line-block {
  margin-top: 0 ;
  margin-bottom: 0 ;
  margin-left: 1.5em }

div.sidebar {
  margin: 0 0 0.5em 1em ;
  border: medium outset ;
  padding: 1em ;
  background-color: #ffffee ;
  width: 40% ;
  float: right ;
  clear: right }

div.sidebar p.rubric {
  font-family: sans-serif ;
  font-size: medium }

div.system-messages {
  margin: 5em }

div.system-messages h1 {
  color: red }

div.system-message {
  border: medium outset ;
  padding: 1em }

div.system-message p.system-message-title {
  color: red ;
  font-weight: bold }

div.topic {
  margin: 2em }

h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
  margin-top: 0.4em }

h1.title {
  text-align: center }

h2.subtitle {
  text-align: center }

hr.docutils {
  width: 75% }

img.align-left, .figure.align-left, object.align-left, table.align-left {
  clear: left ;
  float: left ;
  margin-right: 1em }

img.align-right, .figure.align-right, object.align-right, table.align-right {
  clear: right ;
  float: right ;
  margin-left: 1em }

img.align-center, .figure.align-center, object.align-center {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

table.align-center {
  margin-left: auto;
  margin-right: auto;
}

.align-left {
  text-align: left }

.align-center {
  clear: both ;
  text-align: center }

.align-right {
  text-align: right }

/* reset inner alignment in figures */
div.align-right {
  text-align: inherit }

/* div.align-center * { */
/*   text-align: left } */

.align-top    {
  vertical-align: top }

.align-middle {
  vertical-align: middle }

.align-bottom {
  vertical-align: bottom }

ol.simple, ul.simple {
  margin-bottom: 1em }

ol.arabic {
  list-style: decimal }

ol.loweralpha {
  list-style: lower-alpha }

ol.upperalpha {
  list-style: upper-alpha }

ol.lowerroman {
  list-style: lower-roman }

ol.upperroman {
  list-style: upper-roman }

p.attribution {
  text-align: right ;
  margin-left: 50% }

p.caption {
  font-style: italic }

p.credits {
  font-style: italic ;
  font-size: smaller }

p.label {
  white-space: nowrap }

p.rubric {
  font-weight: bold ;
  font-size: larger ;
  color: maroon ;
  text-align: center }

p.sidebar-title {
  font-family: sans-serif ;
  font-weight: bold ;
  font-size: larger }

p.sidebar-subtitle {
  font-family: sans-serif ;
  font-weight: bold }

p.topic-title {
  font-weight: bold }

pre.address {
  margin-bottom: 0 ;
  margin-top: 0 ;
  font: inherit }

pre.literal-block, pre.doctest-block, pre.math, pre.code {
  margin-left: 2em ;
  margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}

span.classifier {
  font-family: sans-serif ;
  font-style: oblique }

span.classifier-delimiter {
  font-family: sans-serif ;
  font-weight: bold }

span.interpreted {
  font-family: sans-serif }

span.option {
  white-space: nowrap }

span.pre {
  white-space: pre }

span.problematic {
  color: red }

span.section-subtitle {
  /* font-size relative to parent (h1..h6 element) */
  font-size: 80% }

table.citation {
  border-left: solid 1px gray;
  margin-left: 1px }

table.docinfo {
  margin: 2em 4em }

table.docutils {
  margin-top: 0.5em ;
  margin-bottom: 0.5em }

table.footnote {
  border-left: solid 1px black;
  margin-left: 1px }

table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
  padding-left: 0.5em ;
  padding-right: 0.5em ;
  vertical-align: top }

table.docutils th.field-name, table.docinfo th.docinfo-name {
  font-weight: bold ;
  text-align: left ;
  white-space: nowrap ;
  padding-left: 0 }

/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
  border: 0px;
  border-top: 2px solid;
  border-bottom: 2px solid;
  border-collapse: collapse;
}
table.docutils.booktabs * {
  border: 0px;
}
table.docutils.booktabs th {
  border-bottom: thin solid;
  text-align: left;
}

h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
  font-size: 100% }

ul.auto-toc {
  list-style-type: none }

</style>
</head>
<body>
<div class="document">


<div class="line-block">
<div class="line">构建状态 | | 文档状态 | | 模糊测试状态 | | 许可证 |</div>
</div>
<div class="section" id="section-1">
<h1>赞助商</h1>
<p>TinyUSB由以下机构资助：Adafruit。从他们那里购买产品有助于支持此项目。</p>
<div class="figure">
<a class="reference external image-reference" href="https://www.adafruit.com"><object data="docs/assets/adafruit_logo.svg" type="image/svg+xml">Adafruit Logo</object></a>
</div>
</div>
<div class="section" id="tinyusb">
<h1>TinyUSB项目</h1>
<div class="figure">
<object data="docs/assets/logo.svg" type="image/svg+xml">TinyUSB</object>
</div>
<p>TinyUSB是一个开源的跨平台USB主机/设备堆栈，适用于嵌入式系统，设计为内存安全，没有动态分配，并且线程安全，所有中断事件都延迟处理，然后在非ISR任务函数中处理。有关更多详细信息，请查看在线 <a class="reference external" href="https://docs.tinyusb.org/">文档</a> 。</p>
<div class="figure">
<object data="docs/assets/stack.svg" style="width: 500px;" type="image/svg+xml">stackup</object>
</div>
<pre class="literal-block">
.
├── docs            # 文档
├── examples        # 使用make和cmake构建系统的示例
├── hw
│   ├── bsp         # 支持的板卡源文件
│   └── mcu         # 低级mcu核心和外设驱动程序
├── lib             # 来自第三方（如freeRTOS、fatfs）的源代码
├── src             # TinyUSB堆栈本身的全部源代码文件
├── test            # 测试：单元测试、模糊测试、硬件测试
└── tools           # 内部使用的文件
</pre>
</div>
<div class="section" id="section-2">
<h1>入门</h1>
<p>有关使用TinyUSB及其实现的信息，请参阅 <a class="reference external" href="https://docs.tinyusb.org">在线文档</a> 。</p>
<p>我们使用 <a class="reference external" href="https://github.com/hathach/tinyusb/discussions">GitHub Discussions</a> 作为我们的论坛。这是一个询问社区问题和建议或讨论基于TinyUSB的项目的好地方。</p>
<p>有关错误和功能请求，请 <a class="reference external" href="https://github.com/hathach/tinyusb/issues">提交问题</a> 并遵循那里的模板。</p>
<p>请查看 <a class="reference external" href="GettingStarted">入门指南</a> 以将TinyUSB添加到您的项目或构建示例。如果您是TinyUSB的新手，我们建议从 <cite>cdc_msc</cite> 示例开始。</p>
<p>请查看 <a class="reference external" href="Porting">移植指南</a> 以添加对新MCU和板卡的支持。</p>
</div>
<div class="section" id="section-3">
<h1>设备堆栈</h1>
<p>支持通过动态更改USB描述符、低功耗功能（如挂起、恢复和远程唤醒）来支持多个设备配置。以下设备类支持：</p>
<ul class="simple">
<li>音频类 2.0 (UAC2)</li>
<li>蓝牙主机控制器接口 (BTH HCI)</li>
<li>通信设备类 (CDC)</li>
<li>设备固件更新 (DFU)：DFU模式（WIP）和运行时</li>
<li>人体接口设备 (HID)：通用（输入/输出）、键盘、鼠标、游戏手柄等 ...</li>
<li>大容量存储类 (MSC)：具有多个LUN</li>
<li>音乐乐器数字接口 (MIDI)</li>
<li>带有RNDIS、以太网控制模型 (ECM)、网络控制模型 (NCM) 的网络</li>
<li>测试和测量类 (USBTMC)</li>
<li>视频类 1.5 (UVC)：进行中</li>
<li>带有通用输入/输出端点的厂商特定类支持。可以与MS OS 2.0兼容描述符一起使用，无需INF文件即可加载winUSB驱动程序。</li>
<li><a class="reference external" href="https://github.com/WICG/webusb">WebUSB</a> 带有厂商特定类</li>
</ul>
<p>如果您有特殊要求，可以使用 <cite>usbd_app_driver_get_cb()</cite> 来编写自己的类驱动程序，而无需修改堆栈。以下是RPi团队添加其重置接口 <a class="reference external" href="https://github.com/raspberrypi/pico-sdk/pull/197">raspberrypi/pico-sdk#197</a> 的方法。</p>
</div>
<div class="section" id="section-4">
<h1>主机堆栈</h1>
<ul class="simple">
<li>人体接口设备 (HID)：键盘、鼠标、通用</li>
<li>大容量存储类 (MSC)</li>
<li>通信设备类：CDC-ACM</li>
<li>厂商串行通过USB：FTDI、CP210x</li>
<li>支持多级的主机</li>
</ul>
<p>类似于设备堆栈，如果您有特殊要求，可以使用 <cite>usbh_app_driver_get_cb()</cite> 来编写自己的类驱动程序，而无需修改堆栈。</p>
</div>
<div class="section" id="typec-pd">
<h1>TypeC PD堆栈</h1>
<ul class="simple">
<li>供电交付 3.0 (PD3.0) 带USB Type-C支持（进行中）</li>
<li>超早期阶段，仅用于测试目的</li>
<li>仅支持STM32 G4</li>
</ul>
</div>
<div class="section" id="section-5">
<h1>操作系统抽象层</h1>
<p>TinyUSB通过将所有中断服务请求 (ISR) 事件推送到中央队列，然后在非ISR上下文任务函数中稍后处理它们，从而完全线程安全。它还使用信号量/互斥锁来访问共享资源，例如通信设备类 (CDC) FIFO。因此，堆栈需要使用一些操作系统的基本API。以下操作系统已经支持：</p>
<ul class="simple">
<li><strong>无操作系统</strong></li>
<li><strong>FreeRTOS</strong></li>
<li><a class="reference external" href="https://github.com/RT-Thread/rt-thread">RT-Thread</a>: <a class="reference external" href="https://github.com/RT-Thread-packages/tinyusb">repo</a></li>
<li><strong>Mynewt</strong> 由于newt包构建系统，Mynewt示例最好放在其 <a class="reference external" href="https://github.com/hathach/mynewt-tinyusb-example">单独的repo</a></li>
</ul>
</div>
<div class="section" id="cpu">
<h1>支持的CPU</h1>
<p>以下CPU受支持，请查看 <a class="reference external" href="SupportedDevices">支持的设备</a> 以获取每个CPU的驱动程序和功能的完整列表。</p>
<table border="1" class="docutils">
<colgroup>
<col width="19%" />
<col width="7%" />
<col width="74%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Manufacturer</th>
<th class="head" colspan="2">Family</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>Allwinner</td>
<td colspan="2">F1C100s/F1C200s</td>
</tr>
<tr><td>Analog</td>
<td colspan="2">MAX3421E (usb host shield)</td>
</tr>
<tr><td>Brigetek</td>
<td colspan="2">FT90x</td>
</tr>
<tr><td>Broadcom</td>
<td colspan="2">BCM2711, BCM2837</td>
</tr>
<tr><td>Dialog</td>
<td colspan="2">DA1469x</td>
</tr>
<tr><td>Espressif</td>
<td colspan="2">ESP32 S2, S3</td>
</tr>
<tr><td>GigaDevice</td>
<td colspan="2">GD32VF103</td>
</tr>
<tr><td>Infineon</td>
<td colspan="2">XMC4500</td>
</tr>
<tr><td>MicroChip</td>
<td colspan="2"><p class="first">SAM:  D11, D21, D51, E5x, G55, L2x, E7x, S7x, V7x</p>
<p class="last">PIC:  24, 32mm, 32mk, 32mx, 32mz, dsPIC33</p>
</td>
</tr>
<tr><td>Mind Montion</td>
<td colspan="2">mm32</td>
</tr>
<tr><td>NordicSemi</td>
<td colspan="2">nRF52833, nRF52840, nRF5340</td>
</tr>
<tr><td>Nuvoton</td>
<td colspan="2">NUC 120, 121, 125, 126, 505</td>
</tr>
<tr><td>NXP</td>
<td colspan="2"><p class="first">iMXRT: RT10xx, RT11xx</p>
<p>Kinetis: KL, K32L2</p>
<p>LPC: 11u, 13, 15, 17, 18, 40, 43, 51u, 54, 55</p>
<p class="last">MCX: A15, N9</p>
</td>
</tr>
<tr><td>Raspberry Pi</td>
<td colspan="2">RP2040</td>
</tr>
<tr><td>Renesas</td>
<td colspan="2"><p class="first">RA: 4M1, 4M3, 6M1, 6M5</p>
<p class="last">RX: 63N, 65N, 72N</p>
</td>
</tr>
<tr><td>Silabs</td>
<td colspan="2">EFM32GG12</td>
</tr>
<tr><td>Sony</td>
<td colspan="2">CXD56</td>
</tr>
<tr><td>ST STM32</td>
<td colspan="2"><p class="first">F0, F1, F2, F3, F4, F7, G0, G4, H5, H7,</p>
<p class="last">L0, L1, L4, L4+, L5, U5, WB</p>
</td>
</tr>
<tr><td>TI</td>
<td colspan="2">MSP430, MSP432E4, TM4C123</td>
</tr>
<tr><td>ValentyUSB</td>
<td colspan="2">eptri</td>
</tr>
<tr><td>WCH</td>
<td colspan="2"><p class="first">CH32F: F20x</p>
<p class="last">CH32V: V20x, V307</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="section-6">
<h1>许可证</h1>
<p><tt class="docutils literal">src</tt> 文件夹中的所有TinyUSB源代码均受MIT许可证的许可，完整的 <a class="reference external" href="LICENSE">许可证在此</a> 。但是，每个文件都可以单独许可，特别是 <tt class="docutils literal">lib</tt> 和 <tt class="docutils literal">hw/mcu</tt> 文件夹中的文件。请确保您理解您在项目中使用的所有文件的许可证条款。</p>
</div>
<div class="section" id="section-7">
<h1>文档</h1>
<ul class="simple">
<li><a class="reference external" href="docs/_build/html/info/index.html">信息</a><ul>
<li><a class="reference external" href="docs/_build/html/info/uses.html">使用</a></li>
<li><a class="reference external" href="docs/_build/html/info/changelog.html">变更日志</a></li>
<li><a class="reference external" href="docs/_build/html/info/contributors.html">贡献者</a></li>
</ul>
</li>
<li><a class="reference external" href="docs/_build/html/reference/index.html">参考</a><ul>
<li><a class="reference external" href="docs/_build/html/reference/supported.html">Supported Devices 支持的设备</a></li>
<li><a class="reference external" href="docs/_build/html/reference/getting_started.html">入门</a></li>
<li><a class="reference external" href="docs/_build/html/reference/dependencies.html">依赖项</a></li>
<li><a class="reference external" href="docs/_build/html/reference/concurrency.html">并发</a></li>
</ul>
</li>
<li><a class="reference external" href="docs/_build/html/contributing/index.html">贡献</a><ul>
<li><a class="reference external" href="docs/_build/html/contributing/code_of_conduct.html">行为准则</a></li>
<li><a class="reference external" href="docs/_build/html/contributing/structure.html">结构</a></li>
<li><a class="reference external" href="docs/_build/html/contributing/porting.html">移植</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="docs">
<h1>Docs</h1>
<ul class="simple">
<li>Info<ul>
<li><a class="reference external" href="docs/info/uses.rst">Uses</a></li>
<li><a class="reference external" href="docs/info/changelog.rst">Changelog</a></li>
<li><a class="reference external" href="CONTRIBUTORS.rst">Contributors</a></li>
</ul>
</li>
<li><a class="reference external" href="docs/reference/index.rst">Reference</a><ul>
<li><a class="reference external" href="docs/reference/supported.rst">Supported Devices</a></li>
<li><a class="reference external" href="docs/reference/getting_started.rst">Getting Started</a></li>
<li><a class="reference external" href="docs/reference/dependencies.rst">Dependencies</a></li>
<li><a class="reference external" href="docs/reference/concurrency.rst">Concurrency</a></li>
</ul>
</li>
<li><a class="reference external" href="docs/contributing/index.rst">Contributing</a><ul>
<li><a class="reference external" href="CODE_OF_CONDUCT.rst">Code of Conduct</a></li>
<li><a class="reference external" href="docs/contributing/structure.rst">Structure</a></li>
<li><a class="reference external" href="docs/contributing/porting.rst">Porting</a></li>
</ul>
</li>
</ul>
</div>
</div>
</body>
</html>
